#include <iostream>
#include <vector>

using namespace std;

class Solution
{
public:
    int MoreThanHalfNum_Solution(vector<int>& numbers)
    {
        int cond = -1;
        int cnt = 0;
        for (int i = 0; i < numbers.size(); ++i)
        {
            if (cnt == 0)
            {
                cond = numbers[i];
                ++cnt;
            }
            else
            {
                if (cond == numbers[i])
                {
                    ++cnt;
                }
                else
                {
                    --cnt;
                }

            }
        }
        return cond;
    }
};

int main()
{
    vector<int> v;
    v.push_back(2);
    v.push_back(2);
    v.push_back(3);
    v.push_back(3);
    v.push_back(3);
    v.push_back(2);
    v.push_back(2);

    Solution z;
    int n = z.MoreThanHalfNum_Solution(v);

    cout << n << endl;

	return 0;
}
